import { getMenuList } from "@/request/api";

interface menuState{
    menuList:Array<object>
}
const state = {
    menuList:[]
};
const getters = {
    getMenuList(state:menuState){
        return state.menuList
    }
};
const mutations = {
    REQ_MENULIST(state:menuState,payload:any){
        state.menuList = payload
    }
};
const actions = {
    ChangeMenuAction({commit}:any){
        getMenuList().then((res:any)=>{
            commit('REQ_MENULIST',res.data.list)
        })
    }
};
export default {
    state,
    getters,
    mutations,
    actions,
    namespaced:true
}